<?php

require_once "core/config.class.php";
require_once "resources/fckeditor/fckeditor.php";

function smarty_function_fckeditor ($params, &$smarty)
{
    $cfg = Config::getInstance();
    $name = $params["name"];
    $value = $params["value"];
    $height = $params["height"];
    $width = $params["width"];
    
    $fck = new FCKeditor($name);
    $fck->BasePath = $cfg->resurl . "fckeditor/";
    if ($value != NULL) {
        $fck->Value = $value;
    }
    if ($width != NULL) {
        $fck->Width = $width;
    }
    if ($height != NULL) {
        $fck->Height = $height;
    }
    
    $html = $fck->CreateHtml();
    return  $html;
}




